<template>
  <div id="app_mibile">
    <van-tabbar v-model="active_bar">
      <van-tabbar-item icon="home-o" replace to="/">主页</van-tabbar-item>
      <van-tabbar-item icon="search">我的文章</van-tabbar-item>
      <van-tabbar-item icon="friends-o">写文章</van-tabbar-item>
      <van-tabbar-item icon="setting-o" replace to="me_mobile">我的</van-tabbar-item>
    </van-tabbar>
    <router-view></router-view>
  </div>
</template>

<script>
export default {
  name: "AppMobile",
  components: {},
  methods: {},
  data() {
    return {
      active_bar: 0
    };
  },
  beforeCreate() {
    // if (!_isMobile()) {
    //   window.location.href = "/";
    // }
  }
};
function _isMobile() {
  let flag = navigator.userAgent.match(
    /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i
  );
  return flag;
}
</script>

<style>
</style>
